package me.mcx.mcx.web.controller;

import me.mcx.common.core.controller.BaseController;
import me.mcx.common.core.domain.AjaxResult;
import me.mcx.mcx.domain.McxNews;
import me.mcx.mcx.service.IMcxNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 新闻信息管理Controller
 * 
 * @author mcx
 * @date 2024-09-21
 */
@RestController
@RequestMapping("/api/mcx/news")
public class ApiMcxNewsController extends BaseController
{
    @Autowired
    private IMcxNewsService mcxNewsService;

    /**
     * 查询新闻信息管理列表
     */
    @GetMapping("/list")
    public AjaxResult list(McxNews mcxNews)
    {
        List<McxNews> list = mcxNewsService.selectMcxNewsList(mcxNews);
        return success(list);
    }

    /**
     * 获取新闻信息管理详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(mcxNewsService.selectMcxNewsById(id));
    }
}
